package Games.PumpGame.Gui 
{
	import flash.text.TextField;
	import Framework.BaseGui;
	import Games.PumpGame.Entities.Avatar;
	import Games.PumpGame.PumpGame;
	
	/**
	 * ...
	 * @author Menno
	 */
	public class StatisticsGui extends BaseGui 
	{
		private var _moneyField:TextField;
		private var _currentCarry:TextField;
		
		public function StatisticsGui() 
		{
			drawBorder();
			
			initTextfield();
		}
		
		private function initTextfield():void 
		{
			_moneyField = new TextField();
			_currentCarry = new TextField();
			
			_moneyField.text = "Geld:     ";
			_currentCarry.text = "Inhoud:     ";
			
			_moneyField.x = 120 + PumpGame.ROOMSIZE + 10;
			_moneyField.y = 440;
			_moneyField.textColor = 0xFFFFFF;
			
			_currentCarry.x = 120 + PumpGame.ROOMSIZE + 10;
			_currentCarry.y = 470;
			_currentCarry.textColor = 0xFFFFFF;
			
			this.addChild(_moneyField);
			this.addChild(_currentCarry);
		}
		
		override public function draw():void 
		{
			super.draw();
			
			_moneyField.text = "Geld: " + PumpGame.CURRENTFUNDS.toFixed(2);
			_currentCarry.text = "Inhoud: " + Avatar.currentCarry.toFixed(2);			
		}
		
		private function drawBorder():void 
		{
			graphics.lineStyle(2, 0xFFFFFF);
			graphics.drawRect(120 + PumpGame.ROOMSIZE, 430, 150, 150);
		}
		
	}
	
}